<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Gitage - Static server based on git-scm</title>
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/css/bootstrap.min.css"
      integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk"
      crossorigin="anonymous"
    />
  </head>
  <body>
    <div class="container">
      <div class="jumbotron">
        <h1>Gitage</h1>
        <p class="lead">
          Static server based on git-scm, git pages for intranet.
        </p>
      </div>
      <p>Tested on <a href="https:/./gitea.io">gitea</a> for now.</p>
      <h2>Dependencies</h2>
      <ul>
        <li>
          Simple Javascript Template Engine
          <a href="http://github.com/hyjiacan/wet">wet</a>
        </li>
        <li>Git</li>
        <li>Nodejs &gt;8 must be installed on your server</li>
      </ul>

      <h2>Source Code</h2>

      <ul>
        <li>Github: <a href="https://github.com/hyjiacan/gitage">https://github.com/hyjiacan/gitage</a></li>
        <li>Github: <a href="https://gitee.com/hyjiacan/gitage">https://gitee.com/hyjiacan/gitage</a></li>
      </ul>

      <h2>Usage</h2>
      <div class="highlight highlight-source-shell">
        <pre>
          <code>
    npm run build
    node dist/gitage.js
          </code>
        </pre>
      </div>
      <h2>Server Configuration</h2>
      <p>
        Config file: <code>config</code> (case-sensitive), should be put in the
        root path of gitage.
      </p>
      <p><em>config</em></p>
      <pre><code>
    # DEBUG flag
    DEBUG = false
    # ip to host
    HOST = 0.0.0.0
    # port to listen
    PORT = 1997
    # The path to put logs file, can be absolute or relative
    LOG_PATH = logs
    # The path to checkout repository, can be absolute or relative
    PROJECT_ROOT_PATH = projects
    # Log the messages which higher than this level
    LOG_LEVEL = info
    # The temporary  path to the checkout, leave it blank to use the system temp path
    PROJECT_CHECKOUT_TMP =
      </code></pre>
      <blockquote>
        <p>
          If no <em>config</em> file, the value above will be the default
          values.
        </p>
      </blockquote>
      <blockquote>
        <p>Note: Configuration item name must be <strong>UPPERCASE</strong></p>
      </blockquote>
      <h2>Repo Configuration</h2>
      <p>
        Add file <code>gitage.config.json</code> into your repo, in the form
        bellow:
      </p>
      <div>
        <pre>
          <code>
    {
      "type": "markdown",
      "path": "docs",
      "index": "index.html",
      "tag": true,
        "branch": "master",
        "ignore": [
          "file",
          "dir",
          "..."
        ]
    }
          </code>
        </pre>
      </div>
      <ul>
        <li>
          <code>type</code> Deploy type, only <code>markdown</code> supported
          currently, or just leave it blank <strong>case-sensitive</strong>
        </li>
        <li>
          <code>path</code> The directory to deploy (where the static assets
          located in), default: <code>docs</code>
        </li>
        <li>
          <code>index</code> The index file to deploy，default:
          <code>index.html/index.md</code> <strong>case-sensitive</strong>
        </li>
        <li>
          <code>tag</code> Whether to deploy only on
          <code>tag</code> pushed，default: <code>false</code> (planning)
        </li>
      </ul>
      <p>Add web-hook on your repository:</p>
      <p>POST <code>http://127.0.0.1:1997/hook/</code></p>
      <p>
        <code>127.0.0.1</code> The IP to serve <code>1997</code> The port to
        serve
      </p>
      <h2>Screenshots</h2>
      <p>
        <img src="images/1.png" alt="gitage" />
        <img src="images/2.png" alt="gitage" />
      </p>
    </div>
  </body>
</html>
